pp108 : Creating a WS-AppServer Package from Database

Creating a WS-AppServer Package from Database

This topic describes the process of creating a WS-AppServer package using details from the database.

Before you begin this task:
You must create a Database Metadata before creating a WS-AppServer package from a database.

Creating a WS-AppServer Package from database is a one-time activity to create data models, Java code, and Web service Interface on the database tables. This procedure saves time and effort when compared to creating an empty WS-AppServer Package and later updating it with database details.

  1. Select one of the following starting points:
    • In Workspace Documents (My Recent Documents), place the mouse pointer on (Database Metadata), click and select Actions > Generate WS-AppServer Package.
    • In Workspace Documents (Explorer), open <solution> > <project>, right-click (<database metadata >) and select Generate WS-AppServer Package. The WS-AppServer Package Generation Wizard appears, displaying the name of the <database metadata> on its title bar.
  2. Provide the necessary details on the wizard to create the WS-AppServer package.

    Note:

    • You need to enter details on several pages. Click Next on each page to move to the subsequent one. Continue until you complete entering information on the wizard.
      The WS-AppServer package containing the Schemas, is generated with the provided details, and placed in the folder with the name provided in the wizard. If you generated the Java code, it is also created and placed in a separate folder.
    • The generated Schemas and the WS-AppServer package are tightly linked. For more information on this, see topic Using WS-AppServer Package to Model Relational Data.
      The Java Package Name and Namespace appear on the WS-AppServer Package Interface when you open it. For each model, you will see a Mapped Name (usually the name that corresponds to the actual database table name) and a Class Namespace (the name of the Package Namespace). If you do not want to retain the default names, you may replace these with names of your preference. The generated Java code and Web service operation names will reflect the Mapped Name given for the model. You can edit the Mapped Name for Model Attribute in the Attribute Properties pane, which will be reflected in the corresponding method parameter names (both in Java code and Web service operation).

The tables from a Database Metadata are modeled as Standard Classes and stored in the WS-AppServer Package.

If you selected related database tables while creating the WS-AppServer Package, the Standard Classes in the package will retain those relations. As a result, you will not be able to delete any Standard class that has a relation to another Standard Class. Also, if a Custom class inherits, aggregates, or is derived from a Standard class, you cannot delete that Standard class. You can delete a Standard class from the WS-AppServer Package only if the tables were not related at the time of WS-AppServer Package creation and if they are not used by any Custom class.

To delete a Standard class, right-click the class in Models group box and select Delete. This action, however, deletes only the Java classes and not the Web services attached to the class. If required, you must delete the Web services manually. 

After you complete this task:
Publish the generated Java code so that the code is compiled and the Java classes are packaged in a .JAR file.
By default, the .JAR file is stored at <Process_Platform_Installation_Directory>\<instance name>\bsf\runtime\deploy and the location is added to the classpath of the WS-AppServer Service.
The path details are mentioned against the wsappserver.deploy.folder property in the wsapps.properties file located at <Process_Platform_Installation_Directory>\<instance name>\components\wsappserver\config.

An Administrator can modify the path, if required. For example, in Windows, wsappserver.deploy.folder = C:\PROGRA~1\Cordys\DEFAUL~1\bsf\runtime\deploy and in Linux wsappserver.deploy.folder = <Process_Platform_Installation_Directory>\bsf\runtime\deploy. While changing the path, keep the folder separators as they are in the default path.

Related tasks

Updating the WS-AppServer Package with Database Details

Related reference

WS-AppServer Package Generation Wizard Interface

Related information

Using WS-AppServer Package to Model Relational Data
Generating Application and Business Logic on Relational Data